<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>[] 访问对象身上的属性</title>
</head>
<body>

</body>
<script>
    // [] 访问对象身上的属性
    // 对象调用的内部原理 :
    // obj.name ------> obj['name']
    var obj = {
        wife1 : {name : "wife1"},
        wife2 : {name : "wife2"},
        wife3 : {name : "wife3"},
        wife4 : {name : "wife4"},
        wife5 : {name : "wife5"},
        wife6 : {name : "wife6"},
        sayWife : function (num) {
            return this['wife' + num];
        }
    }

    obj.sayWife(1);
</script>
</html>
